package daobeauty.interceptor.invoke.factory.impl;

import java.lang.reflect.Method;

import daobeauty.interceptor.DaoMetaData;
import daobeauty.interceptor.invoke.InvokeStrategy;
import daobeauty.interceptor.invoke.crud.CrudAction;
import daobeauty.interceptor.invoke.factory.InvokeStrategyFactory;
import daobeauty.interceptor.invoke.impl.CrudInvoke;

public abstract class AbstractCrudInvokeFactory implements InvokeStrategyFactory {
	
	public abstract CrudAction createCrudAction();
	
	public final InvokeStrategy create(DaoMetaData daoMetaData, Method daoMethod) {
		return new CrudInvoke(daoMethod, daoMetaData.getSessionFactory(), daoMetaData.getDomainClass(), createCrudAction());
	}
}
